using System;
using UnityEngine;

namespace GameCore
{
    public class DraggableObject : MonoBehaviour
    {
        public event Action OnDragBegin;
        public event Action OnDragEnd;
        
        private void OnMouseDown()
        {
            OnDragBegin?.Invoke();
            PlayerInputHandler.BeginDragObject(this);
        }

        private void OnMouseUp()
        {
            PlayerInputHandler.EndDragObject();
            OnDragEnd?.Invoke();
        }
    }
}